package com.homily.com.test0;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class AndroidWhereActivity extends AppCompatActivity implements View.OnClickListener{


    protected EditText phonenum;
    protected void onCreate( Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_androidwhere);
        findViewById(R.id.bt_phone).setOnClickListener(this);
        phonenum=findViewById(R.id.et_phone_num);
    }

    @Override
    public void onClick(View v) {
        String number=phonenum.getText().toString();
        if (TextUtils.isEmpty(number)){
            Toast.makeText(this,"请输入",Toast.LENGTH_SHORT).show();
        }else {
        Intent intent=new Intent(this,AndroidWhereResultActivity.class);
        Bundle bundle=new Bundle();
        bundle.putString("number",number);
        intent.putExtras(bundle);
        startActivity(intent);}
    }
}
